import numpy as np

dataset = [99, 86, 87, 88, 111, 86, 103, 87, 94, 78, 77, 85, 86]
# 均值
print("均值：", round(np.mean(dataset), 2))
# 中值
print("中值：", round(np.median(dataset), 2))

from scipy import stats

# 众数
print("众数：", stats.mode(dataset))

dataset = [86, 87, 88, 86, 87, 85, 86]
# 标准差
print("标准差：", round(np.std(dataset), 2), "注：标准差通常用 Sigma 符号表示：σ")
# 方差
print("方差：", round(np.var(dataset), 2), "注：方差通常由 Sigma Square 符号 σ2 表示")

dataset = [5, 31, 43, 48, 50, 41, 7, 11, 15, 39, 80, 82, 32, 2, 8, 6, 25, 36, 27, 61, 31]
# 百分位数
print("百分位数：", np.percentile(dataset, 75))
print("百分位数：", np.percentile(dataset, 90))
